﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Reece.Open.Mvc.Atom.Extenders
{
    public static class DateTimeExtenders
    {
        // http://stackoverflow.com/questions/1004698/how-to-truncate-milliseconds-off-of-a-net-datetime
        public static DateTime TruncateMilliseconds(this DateTime source)
        {
            return new DateTime(
                    source.Ticks - (source.Ticks % TimeSpan.TicksPerSecond),
                    source.Kind
                );
        }
    }
}
